package com.peycard.common;

import java.io.Serializable;
import java.util.Arrays;

public class SignatureDTO implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private long idSignature;
	private String token;
	private byte[] serialization;
	private short email;

	public long getIdSignature() {
		return idSignature;
	}

	public void setIdSignature(long idSignature) {
		this.idSignature = idSignature;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public byte[] getSerialization() {
		return serialization;
	}

	public void setSerialization(byte[] serialization) {
		this.serialization = serialization;
	}

	public short getEmail() {
		return email;
	}

	public void setEmail(short email) {
		this.email = email;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + email;
		result = prime * result + (int) (idSignature ^ (idSignature >>> 32));
		result = prime * result + Arrays.hashCode(serialization);
		result = prime * result + ((token == null) ? 0 : token.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SignatureDTO other = (SignatureDTO) obj;
		if (email != other.email)
			return false;
		if (idSignature != other.idSignature)
			return false;
		if (!Arrays.equals(serialization, other.serialization))
			return false;
		if (token == null) {
			if (other.token != null)
				return false;
		} else if (!token.equals(other.token))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "SignatureDTO [idSignature=" + idSignature + ", token=" + token
				+ ", serialization=" + Arrays.toString(serialization)
				+ ", email=" + email + ", getIdSignature()=" + getIdSignature()
				+ ", getToken()=" + getToken() + ", getSerialization()="
				+ Arrays.toString(getSerialization()) + ", getEmail()="
				+ getEmail() + ", hashCode()=" + hashCode() + ", getClass()="
				+ getClass() + ", toString()=" + super.toString() + "]";
	}

}
